<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
      <el-form-item label="所属项目ID" prop="projectId">
        <el-input v-model="queryParams.projectId" placeholder="请输入所属项目ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="所属项目名称" prop="projectName">
        <el-input v-model="queryParams.projectName" placeholder="请输入所属项目名称" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="设备ID" prop="equipmentId">
        <el-input v-model="queryParams.equipmentId" placeholder="请输入设备ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="设备名称" prop="equipmentName">
        <el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="施工日期" prop="constructionDate">
        <el-date-picker clearable v-model="queryParams.constructionDate" type="date" value-format="yyyy-MM-dd HH:mm:ss"
          placeholder="请选择施工日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="记录编号" prop="recordNo">
        <el-input v-model="queryParams.recordNo" placeholder="请输入记录编号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="桩号" prop="pileNo">
        <el-input v-model="queryParams.pileNo" placeholder="请输入桩号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="桩顶标高" prop="pileTopElevation">
        <el-input v-model="queryParams.pileTopElevation" placeholder="请输入桩顶标高" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="桩底标高" prop="pileBottomElevation">
        <el-input v-model="queryParams.pileBottomElevation" placeholder="请输入桩底标高" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="设计桩长" prop="designPileLength">
        <el-input v-model="queryParams.designPileLength" placeholder="请输入设计桩长" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="实际桩长" prop="actualPileLength">
        <el-input v-model="queryParams.actualPileLength" placeholder="请输入实际桩长" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="设计桩径" prop="designPileDiameter">
        <el-input v-model="queryParams.designPileDiameter" placeholder="请输入设计桩径" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="实际桩径" prop="actualPileDiameter">
        <el-input v-model="queryParams.actualPileDiameter" placeholder="请输入实际桩径" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="桩体质量" prop="pileQuality">
        <el-input v-model="queryParams.pileQuality" placeholder="请输入桩体质量" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="水灰比" prop="waterCementRatio">
        <el-input v-model="queryParams.waterCementRatio" placeholder="请输入水灰比" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="水泥用量" prop="cementConsumption">
        <el-input v-model="queryParams.cementConsumption" placeholder="请输入水泥用量" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="水用量" prop="waterConsumption">
        <el-input v-model="queryParams.waterConsumption" placeholder="请输入水用量" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="注浆量" prop="groutVolume">
        <el-input v-model="queryParams.groutVolume" placeholder="请输入注浆量" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="注浆压力" prop="groutingPressure">
        <el-input v-model="queryParams.groutingPressure" placeholder="请输入注浆压力" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="注浆流量" prop="groutingFlowRate">
        <el-input v-model="queryParams.groutingFlowRate" placeholder="请输入注浆流量" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="浇筑方式" prop="pouringMethod">
        <el-input v-model="queryParams.pouringMethod" placeholder="请输入浇筑方式" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="操作员" prop="operator">
        <el-input v-model="queryParams.operator" placeholder="请输入操作员" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="监理人" prop="supervisor">
        <el-input v-model="queryParams.supervisor" placeholder="请输入监理人" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="扩底直径" prop="baseDiameter">
        <el-input v-model="queryParams.baseDiameter" placeholder="请输入扩底直径" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="扩底高度" prop="baseHeight">
        <el-input v-model="queryParams.baseHeight" placeholder="请输入扩底高度" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="扩底方量" prop="baseVolume">
        <el-input v-model="queryParams.baseVolume" placeholder="请输入扩底方量" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="入岩深度" prop="rockEnteringDepth">
        <el-input v-model="queryParams.rockEnteringDepth" placeholder="请输入入岩深度" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="岩层桩长" prop="rockPileLength">
        <el-input v-model="queryParams.rockPileLength" placeholder="请输入岩层桩长" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="岩层情况" prop="rockCondition">
        <el-input v-model="queryParams.rockCondition" placeholder="请输入岩层情况" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="孔径" prop="holeDiameter">
        <el-input v-model="queryParams.holeDiameter" placeholder="请输入孔径" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="孔深" prop="holeDepth">
        <el-input v-model="queryParams.holeDepth" placeholder="请输入孔深" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="咬合方式" prop="biteMethod">
        <el-input v-model="queryParams.biteMethod" placeholder="请输入咬合方式" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="喷射深度" prop="sprayDepth">
        <el-input v-model="queryParams.sprayDepth" placeholder="请输入喷射深度" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="喷射压力" prop="sprayPressure">
        <el-input v-model="queryParams.sprayPressure" placeholder="请输入喷射压力" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="喷射流量" prop="sprayFlowRate">
        <el-input v-model="queryParams.sprayFlowRate" placeholder="请输入喷射流量" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="桩号" prop="pileNo2">
        <el-input v-model="queryParams.pileNo2" placeholder="请输入桩号" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="创建人id" prop="creatorId">
        <el-input v-model="queryParams.creatorId" placeholder="请输入创建人id" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="创建人姓名" prop="creatorName">
        <el-input v-model="queryParams.creatorName" placeholder="请输入创建人姓名" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="最后修改人id" prop="lastUpdaterId">
        <el-input v-model="queryParams.lastUpdaterId" placeholder="请输入最后修改人id" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="最后修改人姓名" prop="lastUpdaterName">
        <el-input v-model="queryParams.lastUpdaterName" placeholder="请输入最后修改人姓名" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="最后修改时间" prop="lastUpdateTime">
        <el-date-picker clearable v-model="queryParams.lastUpdateTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
          placeholder="请选择最后修改时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['pile:projectPilingConstructionRecordsIndex:add']">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['pile:projectPilingConstructionRecordsIndex:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['pile:projectPilingConstructionRecordsIndex:remove']">删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['pile:projectPilingConstructionRecordsIndex:export']">导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="projectPilingConstructionRecordsIndexList"
      @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
      <el-table-column label="所属项目ID" align="center" prop="projectId" />
      <el-table-column label="所属项目名称" align="center" prop="projectName" />
      <el-table-column label="设备ID" align="center" prop="equipmentId" />
      <el-table-column label="设备名称" align="center" prop="equipmentName" />
      <el-table-column label="施工地点" align="center" prop="constructionLocation" />
      <el-table-column label="施工日期" align="center" prop="constructionDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.constructionDate) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="记录编号" align="center" prop="recordNo" />
      <el-table-column label="桩型" align="center" prop="pileType" />
      <el-table-column label="桩号" align="center" prop="pileNo" />
      <el-table-column label="桩顶标高" align="center" prop="pileTopElevation" />
      <el-table-column label="桩底标高" align="center" prop="pileBottomElevation" />
      <el-table-column label="设计桩长" align="center" prop="designPileLength" />
      <el-table-column label="实际桩长" align="center" prop="actualPileLength" />
      <el-table-column label="设计桩径" align="center" prop="designPileDiameter" />
      <el-table-column label="实际桩径" align="center" prop="actualPileDiameter" />
      <el-table-column label="桩体质量" align="center" prop="pileQuality" />
      <el-table-column label="水灰比" align="center" prop="waterCementRatio" />
      <el-table-column label="水泥用量" align="center" prop="cementConsumption" />
      <el-table-column label="水用量" align="center" prop="waterConsumption" />
      <el-table-column label="注浆量" align="center" prop="groutVolume" />
      <el-table-column label="注浆压力" align="center" prop="groutingPressure" />
      <el-table-column label="注浆流量" align="center" prop="groutingFlowRate" />
      <el-table-column label="浇筑方式" align="center" prop="pouringMethod" />
      <el-table-column label="操作员" align="center" prop="operator" />
      <el-table-column label="监理人" align="center" prop="supervisor" />
      <el-table-column label="备注" align="center" prop="remarks" />
      <el-table-column label="扩底直径" align="center" prop="baseDiameter" />
      <el-table-column label="扩底高度" align="center" prop="baseHeight" />
      <el-table-column label="扩底方量" align="center" prop="baseVolume" />
      <el-table-column label="入岩深度" align="center" prop="rockEnteringDepth" />
      <el-table-column label="岩层桩长" align="center" prop="rockPileLength" />
      <el-table-column label="岩层情况" align="center" prop="rockCondition" />
      <el-table-column label="孔径" align="center" prop="holeDiameter" />
      <el-table-column label="孔深" align="center" prop="holeDepth" />
      <el-table-column label="咬合方式" align="center" prop="biteMethod" />
      <el-table-column label="喷射深度" align="center" prop="sprayDepth" />
      <el-table-column label="喷射压力" align="center" prop="sprayPressure" />
      <el-table-column label="喷射流量" align="center" prop="sprayFlowRate" />
      <el-table-column label="桩号" align="center" prop="pileNo2" />
      <!-- <el-table-column label="创建人id" align="center" prop="creatorId" /> -->
      <!-- <el-table-column label="创建人姓名" align="center" prop="creatorName" /> -->
      <!-- <el-table-column label="最后修改人id" align="center" prop="lastUpdaterId" /> -->
      <!-- <el-table-column label="最后修改人姓名" align="center" prop="lastUpdaterName" /> -->
      <!-- <el-table-column label="最后修改时间" align="center" prop="lastUpdateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastUpdateTime) }}</span>
        </template>
      </el-table-column> -->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['pile:projectPilingConstructionRecordsIndex:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['pile:projectPilingConstructionRecordsIndex:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改项目桩机施工记录索引对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="所属项目ID" prop="projectId">
          <el-input v-model="form.projectId" placeholder="请输入所属项目ID" />
        </el-form-item>
        <el-form-item label="所属项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入所属项目名称" />
        </el-form-item>
        <el-form-item label="设备ID" prop="equipmentId">
          <el-input v-model="form.equipmentId" placeholder="请输入设备ID" />
        </el-form-item>
        <el-form-item label="设备名称" prop="equipmentName">
          <el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
        </el-form-item>
        <el-form-item label="施工地点" prop="constructionLocation">
          <el-input v-model="form.constructionLocation" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="施工日期" prop="constructionDate">
          <el-date-picker clearable v-model="form.constructionDate" type="date" value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择施工日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="记录编号" prop="recordNo">
          <el-input v-model="form.recordNo" placeholder="请输入记录编号" />
        </el-form-item>
        <el-form-item label="桩号" prop="pileNo">
          <el-input v-model="form.pileNo" placeholder="请输入桩号" />
        </el-form-item>
        <el-form-item label="桩顶标高" prop="pileTopElevation">
          <el-input v-model="form.pileTopElevation" placeholder="请输入桩顶标高" />
        </el-form-item>
        <el-form-item label="桩底标高" prop="pileBottomElevation">
          <el-input v-model="form.pileBottomElevation" placeholder="请输入桩底标高" />
        </el-form-item>
        <el-form-item label="设计桩长" prop="designPileLength">
          <el-input v-model="form.designPileLength" placeholder="请输入设计桩长" />
        </el-form-item>
        <el-form-item label="实际桩长" prop="actualPileLength">
          <el-input v-model="form.actualPileLength" placeholder="请输入实际桩长" />
        </el-form-item>
        <el-form-item label="设计桩径" prop="designPileDiameter">
          <el-input v-model="form.designPileDiameter" placeholder="请输入设计桩径" />
        </el-form-item>
        <el-form-item label="实际桩径" prop="actualPileDiameter">
          <el-input v-model="form.actualPileDiameter" placeholder="请输入实际桩径" />
        </el-form-item>
        <el-form-item label="桩体质量" prop="pileQuality">
          <el-input v-model="form.pileQuality" placeholder="请输入桩体质量" />
        </el-form-item>
        <el-form-item label="水灰比" prop="waterCementRatio">
          <el-input v-model="form.waterCementRatio" placeholder="请输入水灰比" />
        </el-form-item>
        <el-form-item label="水泥用量" prop="cementConsumption">
          <el-input v-model="form.cementConsumption" placeholder="请输入水泥用量" />
        </el-form-item>
        <el-form-item label="水用量" prop="waterConsumption">
          <el-input v-model="form.waterConsumption" placeholder="请输入水用量" />
        </el-form-item>
        <el-form-item label="注浆量" prop="groutVolume">
          <el-input v-model="form.groutVolume" placeholder="请输入注浆量" />
        </el-form-item>
        <el-form-item label="注浆压力" prop="groutingPressure">
          <el-input v-model="form.groutingPressure" placeholder="请输入注浆压力" />
        </el-form-item>
        <el-form-item label="注浆流量" prop="groutingFlowRate">
          <el-input v-model="form.groutingFlowRate" placeholder="请输入注浆流量" />
        </el-form-item>
        <el-form-item label="浇筑方式" prop="pouringMethod">
          <el-input v-model="form.pouringMethod" placeholder="请输入浇筑方式" />
        </el-form-item>
        <el-form-item label="操作员" prop="operator">
          <el-input v-model="form.operator" placeholder="请输入操作员" />
        </el-form-item>
        <el-form-item label="监理人" prop="supervisor">
          <el-input v-model="form.supervisor" placeholder="请输入监理人" />
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="扩底直径" prop="baseDiameter">
          <el-input v-model="form.baseDiameter" placeholder="请输入扩底直径" />
        </el-form-item>
        <el-form-item label="扩底高度" prop="baseHeight">
          <el-input v-model="form.baseHeight" placeholder="请输入扩底高度" />
        </el-form-item>
        <el-form-item label="扩底方量" prop="baseVolume">
          <el-input v-model="form.baseVolume" placeholder="请输入扩底方量" />
        </el-form-item>
        <el-form-item label="入岩深度" prop="rockEnteringDepth">
          <el-input v-model="form.rockEnteringDepth" placeholder="请输入入岩深度" />
        </el-form-item>
        <el-form-item label="岩层桩长" prop="rockPileLength">
          <el-input v-model="form.rockPileLength" placeholder="请输入岩层桩长" />
        </el-form-item>
        <el-form-item label="岩层情况" prop="rockCondition">
          <el-input v-model="form.rockCondition" placeholder="请输入岩层情况" />
        </el-form-item>
        <el-form-item label="孔径" prop="holeDiameter">
          <el-input v-model="form.holeDiameter" placeholder="请输入孔径" />
        </el-form-item>
        <el-form-item label="孔深" prop="holeDepth">
          <el-input v-model="form.holeDepth" placeholder="请输入孔深" />
        </el-form-item>
        <el-form-item label="咬合方式" prop="biteMethod">
          <el-input v-model="form.biteMethod" placeholder="请输入咬合方式" />
        </el-form-item>
        <el-form-item label="喷射深度" prop="sprayDepth">
          <el-input v-model="form.sprayDepth" placeholder="请输入喷射深度" />
        </el-form-item>
        <el-form-item label="喷射压力" prop="sprayPressure">
          <el-input v-model="form.sprayPressure" placeholder="请输入喷射压力" />
        </el-form-item>
        <el-form-item label="喷射流量" prop="sprayFlowRate">
          <el-input v-model="form.sprayFlowRate" placeholder="请输入喷射流量" />
        </el-form-item>
        <el-form-item label="桩号" prop="pileNo2">
          <el-input v-model="form.pileNo2" placeholder="请输入桩号" />
        </el-form-item>
        <el-form-item label="创建人id" prop="creatorId">
          <el-input v-model="form.creatorId" placeholder="请输入创建人id" />
        </el-form-item>
        <el-form-item label="创建人姓名" prop="creatorName">
          <el-input v-model="form.creatorName" placeholder="请输入创建人姓名" />
        </el-form-item>
        <el-form-item label="最后修改人id" prop="lastUpdaterId">
          <el-input v-model="form.lastUpdaterId" placeholder="请输入最后修改人id" />
        </el-form-item>
        <el-form-item label="最后修改人姓名" prop="lastUpdaterName">
          <el-input v-model="form.lastUpdaterName" placeholder="请输入最后修改人姓名" />
        </el-form-item>
        <el-form-item label="最后修改时间" prop="lastUpdateTime">
          <el-date-picker clearable v-model="form.lastUpdateTime" type="date" value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="请选择最后修改时间">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listProjectPilingConstructionRecordsIndex, getProjectPilingConstructionRecordsIndex, delProjectPilingConstructionRecordsIndex, addProjectPilingConstructionRecordsIndex, updateProjectPilingConstructionRecordsIndex } from "@/api/pile/projectPilingConstructionRecordsIndex";

export default {
  name: "ProjectPilingConstructionRecordsIndex",
  data() {
    return {
      // 根路径
      baseURL: process.env.VUE_APP_BASE_API,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 项目桩机施工记录索引表格数据
      projectPilingConstructionRecordsIndexList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        projectId: null,
        projectName: null,
        equipmentId: null,
        equipmentName: null,
        constructionLocation: null,
        constructionDate: null,
        recordNo: null,
        pileType: null,
        pileNo: null,
        pileTopElevation: null,
        pileBottomElevation: null,
        designPileLength: null,
        actualPileLength: null,
        designPileDiameter: null,
        actualPileDiameter: null,
        pileQuality: null,
        waterCementRatio: null,
        cementConsumption: null,
        waterConsumption: null,
        groutVolume: null,
        groutingPressure: null,
        groutingFlowRate: null,
        pouringMethod: null,
        operator: null,
        supervisor: null,
        remarks: null,
        baseDiameter: null,
        baseHeight: null,
        baseVolume: null,
        rockEnteringDepth: null,
        rockPileLength: null,
        rockCondition: null,
        holeDiameter: null,
        holeDepth: null,
        biteMethod: null,
        sprayDepth: null,
        sprayPressure: null,
        sprayFlowRate: null,
        pileNo2: null,
        creatorId: null,
        creatorName: null,
        lastUpdaterId: null,
        lastUpdaterName: null,
        lastUpdateTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          { required: true, message: "主键id不能为空", trigger: "blur" }
        ],
        projectId: [
          { required: true, message: "所属项目ID不能为空", trigger: "blur" }
        ],
        projectName: [
          { required: true, message: "所属项目名称不能为空", trigger: "blur" }
        ],
        equipmentId: [
          { required: true, message: "设备ID不能为空", trigger: "blur" }
        ],
        equipmentName: [
          { required: true, message: "设备名称不能为空", trigger: "blur" }
        ],
        constructionLocation: [
          { required: true, message: "施工地点不能为空", trigger: "blur" }
        ],
        constructionDate: [
          { required: true, message: "施工日期不能为空", trigger: "blur" }
        ],
        recordNo: [
          { required: true, message: "记录编号不能为空", trigger: "blur" }
        ],
        pileType: [
          { required: true, message: "桩型不能为空", trigger: "change" }
        ],
        pileNo: [
          { required: true, message: "桩号不能为空", trigger: "blur" }
        ],
        pileTopElevation: [
          { required: true, message: "桩顶标高不能为空", trigger: "blur" }
        ],
        pileBottomElevation: [
          { required: true, message: "桩底标高不能为空", trigger: "blur" }
        ],
        designPileLength: [
          { required: true, message: "设计桩长不能为空", trigger: "blur" }
        ],
        actualPileLength: [
          { required: true, message: "实际桩长不能为空", trigger: "blur" }
        ],
        designPileDiameter: [
          { required: true, message: "设计桩径不能为空", trigger: "blur" }
        ],
        actualPileDiameter: [
          { required: true, message: "实际桩径不能为空", trigger: "blur" }
        ],
        pileQuality: [
          { required: true, message: "桩体质量不能为空", trigger: "blur" }
        ],
        waterCementRatio: [
          { required: true, message: "水灰比不能为空", trigger: "blur" }
        ],
        cementConsumption: [
          { required: true, message: "水泥用量不能为空", trigger: "blur" }
        ],
        waterConsumption: [
          { required: true, message: "水用量不能为空", trigger: "blur" }
        ],
        groutVolume: [
          { required: true, message: "注浆量不能为空", trigger: "blur" }
        ],
        groutingPressure: [
          { required: true, message: "注浆压力不能为空", trigger: "blur" }
        ],
        groutingFlowRate: [
          { required: true, message: "注浆流量不能为空", trigger: "blur" }
        ],
        pouringMethod: [
          { required: true, message: "浇筑方式不能为空", trigger: "blur" }
        ],
        operator: [
          { required: true, message: "操作员不能为空", trigger: "blur" }
        ],
        supervisor: [
          { required: true, message: "监理人不能为空", trigger: "blur" }
        ],
        remarks: [
          { required: true, message: "备注不能为空", trigger: "blur" }
        ],
        baseDiameter: [
          { required: true, message: "扩底直径不能为空", trigger: "blur" }
        ],
        baseHeight: [
          { required: true, message: "扩底高度不能为空", trigger: "blur" }
        ],
        baseVolume: [
          { required: true, message: "扩底方量不能为空", trigger: "blur" }
        ],
        rockEnteringDepth: [
          { required: true, message: "入岩深度不能为空", trigger: "blur" }
        ],
        rockPileLength: [
          { required: true, message: "岩层桩长不能为空", trigger: "blur" }
        ],
        rockCondition: [
          { required: true, message: "岩层情况不能为空", trigger: "blur" }
        ],
        holeDiameter: [
          { required: true, message: "孔径不能为空", trigger: "blur" }
        ],
        holeDepth: [
          { required: true, message: "孔深不能为空", trigger: "blur" }
        ],
        biteMethod: [
          { required: true, message: "咬合方式不能为空", trigger: "blur" }
        ],
        sprayDepth: [
          { required: true, message: "喷射深度不能为空", trigger: "blur" }
        ],
        sprayPressure: [
          { required: true, message: "喷射压力不能为空", trigger: "blur" }
        ],
        sprayFlowRate: [
          { required: true, message: "喷射流量不能为空", trigger: "blur" }
        ],
        pileNo2: [
          { required: true, message: "桩号不能为空", trigger: "blur" }
        ],
        creatorId: [
          { required: true, message: "创建人id不能为空", trigger: "blur" }
        ],
        creatorName: [
          { required: true, message: "创建人姓名不能为空", trigger: "blur" }
        ],
        lastUpdaterId: [
          { required: true, message: "最后修改人id不能为空", trigger: "blur" }
        ],
        lastUpdaterName: [
          { required: true, message: "最后修改人姓名不能为空", trigger: "blur" }
        ],
        lastUpdateTime: [
          { required: true, message: "最后修改时间不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询项目桩机施工记录索引列表 */
    getList() {
      this.loading = true;
      listProjectPilingConstructionRecordsIndex(this.queryParams).then(response => {
        this.projectPilingConstructionRecordsIndexList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        projectId: null,
        projectName: null,
        equipmentId: null,
        equipmentName: null,
        constructionLocation: null,
        constructionDate: null,
        recordNo: null,
        pileType: null,
        pileNo: null,
        pileTopElevation: null,
        pileBottomElevation: null,
        designPileLength: null,
        actualPileLength: null,
        designPileDiameter: null,
        actualPileDiameter: null,
        pileQuality: null,
        waterCementRatio: null,
        cementConsumption: null,
        waterConsumption: null,
        groutVolume: null,
        groutingPressure: null,
        groutingFlowRate: null,
        pouringMethod: null,
        operator: null,
        supervisor: null,
        remarks: null,
        baseDiameter: null,
        baseHeight: null,
        baseVolume: null,
        rockEnteringDepth: null,
        rockPileLength: null,
        rockCondition: null,
        holeDiameter: null,
        holeDepth: null,
        biteMethod: null,
        sprayDepth: null,
        sprayPressure: null,
        sprayFlowRate: null,
        pileNo2: null,
        creatorId: null,
        creatorName: null,
        lastUpdaterId: null,
        lastUpdaterName: null,
        lastUpdateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加项目桩机施工记录索引";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getProjectPilingConstructionRecordsIndex(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改项目桩机施工记录索引";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateProjectPilingConstructionRecordsIndex(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProjectPilingConstructionRecordsIndex(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除项目桩机施工记录索引编号为"' + ids + '"的数据项？').then(function () {
        return delProjectPilingConstructionRecordsIndex(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('pile/projectPilingConstructionRecordsIndex/export', {
        ...this.queryParams
      }, `projectPilingConstructionRecordsIndex_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
